package com.my.server;

import com.my.encoder.DetectHttp;
import com.my.handler.HttpHandler;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;


/**
 * @Author hujf
 * @Date 2021/10/25 9:35
 * @Description 创建一个管道工厂,用于添加各种请求的处理
 */
public class PipelineFactory implements ChannelPipelineFactory {



    @Override
    public ChannelPipeline getPipeline() {
        ChannelPipeline pipeline = Channels.pipeline();


        pipeline.addLast("detect",getDetectHttp());
        return pipeline;
    }

    private ChannelHandler getDetectHttp() {
        DetectHttp detectHttp = new DetectHttp();
        return detectHttp;
    }
}
